<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>field_all_record</title>
<link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
	function jq_updateRental(obj){
		var id = $(obj).parent().find("label").find("input").val();
		var amount = $(obj).parent().find("div").find("input").val()
		$.ajax({ 
			url: "field_updateRental?field_rental.field_rental_id="+id+"&"+"field_rental.rental_amount="+amount,
			success: function(data){
				alert(date);
	      }});
	}
</script>
<style type="text/css">
body{
	background-color:#FFFFE0;
}
	#main_content{
		margin:0 auto;
		padding-top:30px;
		margin-top:50px;		
		width:600px;
		height:200px;
		border:1px solid #AEEEEE;
		background-color:#FAFAFA;
	}
</style>
<body>
<%@include file = "../../navigationBar.jsp" %> 

<div id="main_content">
		<s:iterator value="#request.rental_list" var="rental_listname">
		  <div class="form-group">
		    <label for="fieldName" class="col-sm-6 control-label">
		    	<s:if test="#rental_listname.field_rental_id == 1401">
		    		<input class="col-sm-4" type="text" disabled="disabled" value="1401"/>
		    		<input class="col-sm-8" type="text" disabled="disabled" value="篮球场"/>
		    	</s:if>
		    	<s:elseif test="#rental_listname.field_rental_id == 1402">
		    		<input class="col-sm-4" type="text" disabled="disabled" value="1402"/>
		    		<input class="col-sm-8" type="text" disabled="disabled" value="足球场"/>
		    	</s:elseif>
		    	<s:elseif test="#rental_listname.field_rental_id == 1403">
		    		<input class="col-sm-4" type="text" disabled="disabled" value="1403"/>
		    		<input class="col-sm-8" type="text" disabled="disabled" value="羽毛球"/>
		    	</s:elseif>
		    	<s:elseif test="#rental_listname.field_rental_id == 1404">
		    		<input class="col-sm-4" type="text" disabled="disabled" value="1404"/>
		    		<input class="col-sm-8" type="text" disabled="disabled" value="棒球场"/>
		    	</s:elseif>
	    	</label>
		    <div class="col-sm-4">
		      <input type="text" name="field_rental.rental_amount" value='<s:property value="#rental_listname.rental_amount"/>'/>
		    </div>
		    <a class="btn btn-default col-sm-2" onclick="jq_updateRental(this)">修改租金</a>
		  </div>
		</s:iterator>	 
</div>
</body>
</html>